<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!-- 导航栏 -->
<!--<nav class="navbar navbar-expand-lg sticky-top navbar-light bg-light flex-md-nowrap p-0" id="nav" th:fragment="topBar">-->
    <nav class="navbar navbar-expand-lg sticky-top navbar-light bg-light " id="nav" th:fragment="topBar">
    <div class="collapse navbar-collapse col-md-10 offset-md-1 animate__animated  animate__zoomIn"
         id="navbarSupportedContent" style="z-index: 999999">
        <a id="logo-img" class="navbar-brand col-sm-3 col-md-2 mr-0" th:href="@{/index.html}">
            <a id="logo-img" class="navbar-brand col-sm-3 col-md-2 mr-0" th:href="@{/index.html}">
            <img alt="Brand" th:src="@{/airent/common/imgs/logo_small.png}">
        </a>
        <ul class="navbar-nav mr-auto">
            <li class="nav-item">
                <a id="select-city" class="nav-link" th:href="@{/selectcity.html}">  <!--th:href="@{/selectcity.html}"-->
                    <svg id="city-icon" class="bi bi-building" width="1em"
                         height="1em" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
                        <path fill-rule="evenodd"
                              d="M15.285.089A.5.5 0 0 1 15.5.5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5V14h-1v1.5a.5.5 0 0 1-.5.5H1a.5.5 0 0 1-.5-.5v-6a.5.5 0 0 1 .418-.493l5.582-.93V3.5a.5.5 0 0 1 .324-.468l8-3a.5.5 0 0 1 .46.057zM7.5 3.846V8.5a.5.5 0 0 1-.418.493l-5.582.93V15h8v-1.5a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 .5.5V15h2V1.222l-7 2.624z" />
                        <path fill-rule="evenodd" d="M6.5 15.5v-7h1v7h-1z" />
                        <path
                                d="M2.5 11h1v1h-1v-1zm2 0h1v1h-1v-1zm-2 2h1v1h-1v-1zm2 0h1v1h-1v-1zm6-10h1v1h-1V3zm2 0h1v1h-1V3zm-4 2h1v1h-1V5zm2 0h1v1h-1V5zm2 0h1v1h-1V5zm-2 2h1v1h-1V7zm2 0h1v1h-1V7zm-4 0h1v1h-1V7zm0 2h1v1h-1V9zm2 0h1v1h-1V9zm2 0h1v1h-1V9zm-4 2h1v1h-1v-1zm2 0h1v1h-1v-1zm2 0h1v1h-1v-1z" />
                    </svg>
                    <span th:hidden="${param.city} == null" th:text="${param.city}">选择城市</span>
                </a>
            </li>
        </ul>
        <ul class="navbar-nav mr-5 ">
            <li class="nav-item">
                <!--class="nav-link"-->
                <a class="nav-link" th:href="@{/searchhouse.html(city=${param.city})}" th:class="${activeUri=='rent'?'nav-link active':'nav-link'}">租房</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/issuehouse.html(city=${param.city})}" th:class="${activeUri=='release'?'nav-link active':'nav-link'}">发布房源</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/roommate(city=${param.city})}" th:class="${activeUri=='roommate'?'nav-link active':'nav-link'}">寻找室友</a>
            </li>
            <li class="nav-item" shiro:authenticated>
                <a class="nav-link" href="/article.html">论坛</a>
            </li>
            <li class="nav-item" shiro:hasRole="admin">
                <a class="nav-link" th:href="@{/userManage(city=${param.city})}" th:class="${activeUri=='manage'?'nav-link active':'nav-link'}">我是管理员</a>
            </li>
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" th:class="${activeUri=='xieyi'?'nav-link active':'nav-link'}"
                   aria-haspopup="true" aria-expanded="false">
                    指南
                </a>
                <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                    <a class="dropdown-item" th:href="@{/Agreement}" >用户协议</a>
                    <a class="dropdown-item" th:href="@{/Potplayer}" >隐私政策</a>
                    <a class="dropdown-item" th:href="@{/Commitment}" >服务承诺</a>
                    <div class="dropdown-divider"></div>
                   <!-- <a class="dropdown-item" href="about.html" >关于我们</a>-->
                </div>
            </li>
        </ul>
        <div th:if="${session.user == null}">
            <a th:href="@{/login_register.html}" id="login-button1" class="btn btn-outline-success active animate__animated animate__pulse"
               role="button" aria-pressed="true">登录/注册</a>
        </div>
        <div th:if="${session.user != null}">
            <a th:href="@{/houseCol/userInfo}" id="login-button2" class="btn btn-outline-success active animate__animated animate__pulse"
               role="button" aria-pressed="true" >个人中心</a>
            <a th:href="@{/logout}" id="login-button4" class="btn btn-outline-success active animate__animated animate__pulse"
               role="button" aria-pressed="true" >退出</a>
        </div>
    </div>
</nav>
<script th:inline="javascript">
    function changeCity(){
        let url = window.location.href;
        alert(url);
    }

</script>
</body>
</html>
